-
Notifications
You must be signed in to change notification settings - Fork 4
STAC-22568: Adding dashboard command #109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Contributor
Author
Dashboard CLI Commands - Manual Testing Results by AgentDate: 2025-08-22 1. Dashboard List CommandBasic Functionality
$ export STS_EXPERIMENTAL_DASHBOARD=1 && go run main.go dashboard list
$ export STS_EXPERIMENTAL_DASHBOARD=1 && go run main.go dashboard list
ID | IDENTIFIER | NAME | DESCRIPTION | SCOPE
124291188225796 | urn:custom:dashboard:057a7ff0-e081-48ea-b7da-b5c065e440dc | test-apply-dashboard-updated | Updated dashboard description via apply command | privateDashboard
199184984075103 | urn:custom:dashboard:075b2e37-c59b-4abb-b9eb-50201bee6402 | dashboard-name | dashboard description 2 | publicDashboard
118762123067505 | urn:custom:dashboard:166181bf-4468-4a80-8d4d-9fb643263d06 | test-clone-desc | Custom description | publicDashboard
71119196500053 | urn:custom:dashboard:1cc76677-24fa-4c30-b13f-7f673a9106f4 | test-clone-full | Full test | privateDashboard
77906455245601 | urn:custom:dashboard:1eb81866-bdd0-4051-8d90-72f637d771fb | test-clone-public | dashboard description | publicDashboard
63410966880 | urn:custom:dashboard:2a63f4a6-cb28-4d94-9277-eb2d136d03a4 | test-clone-public | dashboard description | publicDashboard
40143328578960 | urn:custom:dashboard:48f091d1-3d2c-4266-a33d-744da3ec4c2c | apply-test-dashboard | Dashboard created via apply command | publicDashboardOutput Formats
$ export STS_EXPERIMENTAL_DASHBOARD=1 && go run main.go dashboard list --output json
{
"dashboards": [
{
"_type": "DashboardReadMetadataSchema",
"description": "Updated dashboard description via apply command",
"id": 124291188225796,
"identifier": "urn:custom:dashboard:057a7ff0-e081-48ea-b7da-b5c065e440dc",
"lastUpdateTimestamp": 1755774382662,
"name": "test-apply-dashboard-updated",
"ownerId": 253353873643863,
"scope": "privateDashboard"
}
// [Additional 11 dashboards in array]
]
}Error Handling
$ export STS_EXPERIMENTAL_DASHBOARD=1 && go run main.go dashboard list --help
List all dashboards.
Minimum supported StackState version: 5.0.0
Usage:
sts dashboard list [flags]
Flags:
-h, --help help for list
Global Flags:
--api-token string Specify the API token of the StackState server
...2. Dashboard Describe CommandBasic Functionality
$ export STS_EXPERIMENTAL_DASHBOARD=1 && go run main.go dashboard describe --id 124291188225796
{
"_type": "DashboardReadFullSchema",
"dashboard": {
"spec": {
"layouts": [
{
"kind": "Grid",
"spec": {
"items": []
}
}
],
"panels": {}
}
},
"description": "Updated dashboard description via apply command",
"id": 124291188225796,
"identifier": "urn:custom:dashboard:057a7ff0-e081-48ea-b7da-b5c065e440dc",
"lastUpdateTimestamp": 1755774382662,
"name": "test-apply-dashboard-updated",
"ownerId": 253353873643863,
"scope": "privateDashboard"
}
$ export STS_EXPERIMENTAL_DASHBOARD=1 && go run main.go dashboard describe --identifier "urn:custom:dashboard:057a7ff0-e081-48ea-b7da-b5c065e440dc"
{
"_type": "DashboardReadFullSchema",
"dashboard": {
"spec": {
"layouts": [
{
"kind": "Grid",
"spec": {
"items": []
}
}
],
"panels": {}
}
},
"description": "Updated dashboard description via apply command",
"id": 124291188225796,
"identifier": "urn:custom:dashboard:057a7ff0-e081-48ea-b7da-b5c065e440dc",
"lastUpdateTimestamp": 1755774382662,
"name": "test-apply-dashboard-updated",
"ownerId": 253353873643863,
"scope": "privateDashboard"
}File Output
$ export STS_EXPERIMENTAL_DASHBOARD=1 && go run main.go dashboard describe --id 124291188225796 --file /tmp/dashboard_test.json
✅ Dashboard exported to: /tmp/dashboard_test.json
$ cat /tmp/dashboard_test.json
{
"_type": "DashboardReadFullSchema",
"dashboard": {
"spec": {
"layouts": [
{
"kind": "Grid",
"spec": {
"items": []
}
}
],
"panels": {}
}
},
"description": "Updated dashboard description via apply command",
"id": 124291188225796,
"identifier": "urn:custom:dashboard:057a7ff0-e081-48ea-b7da-b5c065e440dc",
"lastUpdateTimestamp": 1755774382662,
"name": "test-apply-dashboard-updated",
"ownerId": 253353873643863,
"scope": "privateDashboard"
}Output Formats
$ export STS_EXPERIMENTAL_DASHBOARD=1 && go run main.go dashboard describe --id 124291188225796 --output json
{
"data": "{\n \"_type\": \"DashboardReadFullSchema\",\n \"dashboard\": {\n \"spec\": {\n \"layouts\": [\n {\n \"kind\": \"Grid\",\n \"spec\": {\n \"items\": []\n }\n }\n ],\n \"panels\": {}\n }\n },\n \"description\": \"Updated dashboard description via apply command\",\n \"id\": 124291188225796,\n \"identifier\": \"urn:custom:dashboard:057a7ff0-e081-48ea-b7da-b5c065e440dc\",\n \"lastUpdateTimestamp\": 1755774382662,\n \"name\": \"test-apply-dashboard-updated\",\n \"ownerId\": 253353873643863,\n \"scope\": \"privateDashboard\"\n}",
"format": "json"
}Error Handling
$ export STS_EXPERIMENTAL_DASHBOARD=1 && go run main.go dashboard describe
❌ One of the required flags {id | identifier} not set
$ export STS_EXPERIMENTAL_DASHBOARD=1 && go run main.go dashboard describe --help
Describe a dashboard in StackState Templated YAML.
Minimum supported StackState version: 5.0.0
Usage:
sts dashboard describe { --id ID | --identifier IDENTIFIER } [flags]
Flags:
-f, --file string Path to the output file
-h, --help help for describe
--id int ID of the dashboard
--identifier string Identifier (URN) of the dashboard
Global Flags:
--api-token string Specify the API token of the StackState server
...3. Dashboard Clone CommandBasic Functionality
$ export STS_EXPERIMENTAL_DASHBOARD=1 && go run main.go dashboard clone --id 124291188225796 --name "manual-test-clone"
✅ Dashboard cloned successfully! New dashboard ID: 46319049594379, Name: manual-test-clone
$ export STS_EXPERIMENTAL_DASHBOARD=1 && go run main.go dashboard clone --identifier "urn:custom:dashboard:057a7ff0-e081-48ea-b7da-b5c065e440dc" --name "manual-test-clone-2"
✅ Dashboard cloned successfully! New dashboard ID: 12792522987115, Name: manual-test-clone-2Optional Parameters
$ export STS_EXPERIMENTAL_DASHBOARD=1 && go run main.go dashboard clone --id 124291188225796 --name "manual-test-scope-fail" --scope "invalid"
❌ Invalid scope: invalid. Must be 'publicDashboard' or 'privateDashboard'
$ export STS_EXPERIMENTAL_DASHBOARD=1 && go run main.go dashboard clone --id 124291188225796 --name "manual-test-private" --scope "privateDashboard"
✅ Dashboard cloned successfully! New dashboard ID: 94079602342608, Name: manual-test-private4. Dashboard Delete CommandBasic Functionality
$ export STS_EXPERIMENTAL_DASHBOARD=1 && go run main.go dashboard delete --id 46319049594379
✅ Dashboard deleted: 463190495943795. Dashboard Apply CommandCreate New Dashboard
$ cat > /tmp/manual_test_dashboard.json << 'EOF'
{
"name": "manual-test-apply",
"description": "Dashboard created during manual testing",
"scope": "publicDashboard",
"dashboard": {
"spec": {
"layouts": [
{
"kind": "Grid",
"spec": {
"items": []
}
}
],
"panels": {}
}
}
}
EOF
$ export STS_EXPERIMENTAL_DASHBOARD=1 && go run main.go dashboard apply --file /tmp/manual_test_dashboard.json
✅ Dashboard created successfully! ID: 115140946305302, Name: manual-test-apply6. Dashboard Edit CommandBasic Functionality (No Changes)
$ export STS_EXPERIMENTAL_DASHBOARD=1 && EDITOR=cat go run main.go dashboard edit --id 115140946305302
{
"_type": "DashboardReadFullSchema",
"dashboard": {
"spec": {
"layouts": [
{
"kind": "Grid",
"spec": {
"items": []
}
}
],
"panels": {}
}
},
"description": "Dashboard created during manual testing",
"id": 115140946305302,
"identifier": "urn:custom:dashboard:60b38960-ac87-436a-80c4-7cf8a1404c6b",
"lastUpdateTimestamp": 1755867480683,
"name": "manual-test-apply",
"ownerId": 253353873643863,
"scope": "publicDashboard"
}
⚠️ No changes made7. General Command TestsMain Dashboard Command
$ export STS_EXPERIMENTAL_DASHBOARD=1 && go run main.go dashboard
Manage, test and develop dashboards.
Usage:
sts dashboard [command]
Available Commands:
apply Create or edit a dashboard from JSON
clone Clone a dashboard
delete Delete a dashboard
describe Describe a dashboard in STY format
edit Edit a dashboard
list List all dashboards
Use "sts dashboard [command] --help" for more information about a command. |
deontaljaard
approved these changes
Aug 25, 2025
Contributor
deontaljaard
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
New Commands:
Features:
Usage
Testing: